﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutShow.cshtml";

    var RushData = ViewBag.RushData as List<RushViewModel>;
}

<div class="content content-nav-base buytoday-content">
    <div id="list-cont">
        @*<div class="banner-box">
                <div class="banner"></div>
            </div>*@
        <div class="product-list-box">
            <div class="product-list w1200">
                <div class="tab-title">
                    @foreach (var item in RushData)
                    {
                        <a href="javascript:;" class="@(item.IsCurrent?"active tuang":"")" data-content="d@(item.StartTime.ToFileTime())" style="margin-right: 30px;">@item.TimeStr</a>
                    }
                    @*<a href="javascript:;" class="active tuang" data-content="tuangou" style="margin-right: 30px;">今日团购</a>
                        <a href="javascript:;" data-content="yukao" style="margin-right: 30px;">明日预告</a>
                        <a href="javascript:;" data-content="dian3" style="margin-right: 30px;">3点场</a>*@
                </div>
                @foreach (var item in RushData)
                {
                    <div class="list-cont @(item.IsCurrent?"":"layui-hide")" cont='d@(item.StartTime.ToFileTime())'>
                        <div class="item-box layui-clear">
                            @foreach (var item2 in item.Rushs)
                            {
                                <div class="item">
                                    <img src="@item2.PicUrl" alt="" style="width:290px;height:320px;">
                                    <div class="text-box">
                                        <p class="title">@item2.Title</p>
                                        <p class="plic">
                                            <span class="ciur-pic">￥@item2.ZkFinalPrice</span>
                                            <span class="Ori-pic">￥@item2.ReservePrice</span>
                                            <span class="discount"><a href="@item2.ClickUrl" target="_blank">去抢</a></span>
                                        </p>
                                    </div>
                                </div>
                            }
                        </div>
                    </div>
                }
                @*<div class="list-cont" cont='tuangou'>
                        <div class="item-box layui-clear">
                            <div class="item">
                                <img src="../Content/static/img/tuan_img1.jpg" alt="">
                                <div class="text-box">
                                    <p class="title">宝宝专用硅胶环保饭碗四套+调羹+筷子自助学吃饭套装</p>
                                    <p class="plic">
                                        <span class="ciur-pic">￥100.00</span>
                                        <span class="Ori-pic">￥208.00</span>
                                        <span class="discount">5折</span>
                                    </p>
                                </div>
                            </div>
                            <div class="item">
                                <img src="../Content/static/img/tuan_img3.jpg" alt="">
                                <div class="text-box">
                                    <p class="title">宝宝专用硅胶环保饭碗四套+调羹+筷子自助学吃饭套装</p>
                                    <p class="plic">
                                        <span class="ciur-pic">￥100.00</span>
                                        <span class="Ori-pic">￥208.00</span>
                                        <span class="discount">5折</span>
                                    </p>
                                </div>
                            </div>
                            <div class="item">
                                <img src="../Content/static/img/tuan_img4.jpg" alt="">
                                <div class="text-box">
                                    <p class="title">宝宝专用硅胶环保饭碗四套+调羹+筷子自助学吃饭套装</p>
                                    <p class="plic">
                                        <span class="ciur-pic">￥100.00</span>
                                        <span class="Ori-pic">￥208.00</span>
                                        <span class="discount">5折</span>
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div id="demo0" style="text-align: center;"></div>
                    </div>
                    <div class="list-cont layui-hide" cont='yukao'>
                        <div class="item-box layui-clear">

                            <div class="item">
                                <img src="../Content/static/img/tuan_img2.jpg" alt="">
                                <div class="text-box">
                                    <p class="title">宝宝专用硅胶环保饭碗四套+调羹+筷子自助学吃饭套装</p>
                                    <p class="plic">
                                        <span class="ciur-pic">￥100.00</span>
                                        <span class="Ori-pic">￥208.00</span>
                                        <span class="discount">5折</span>
                                    </p>
                                </div>
                            </div>
                            <div class="item">
                                <img src="../Content/static/img/tuan_img3.jpg" alt="">
                                <div class="text-box">
                                    <p class="title">宝宝专用硅胶环保饭碗四套+调羹+筷子自助学吃饭套装</p>
                                    <p class="plic">
                                        <span class="ciur-pic">￥100.00</span>
                                        <span class="Ori-pic">￥208.00</span>
                                        <span class="discount">5折</span>
                                    </p>
                                </div>
                            </div>
                            <div class="item">
                                <img src="../Content/static/img/tuan_img4.jpg" alt="">
                                <div class="text-box">
                                    <p class="title">宝宝专用硅胶环保饭碗四套+调羹+筷子自助学吃饭套装</p>
                                    <p class="plic">
                                        <span class="ciur-pic">￥100.00</span>
                                        <span class="Ori-pic">￥208.00</span>
                                        <span class="discount">5折</span>
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div id="demo1" style="text-align: center;"></div>
                    </div>
                    <div class="list-cont layui-hide" cont='dian3'>
                        <div class="item-box layui-clear">

                            <div class="item">
                                <img src="../Content/static/img/tuan_img2.jpg" alt="">
                                <div class="text-box">
                                    <p class="title">3333环保饭碗四套+调羹+筷子自助学吃饭套装</p>
                                    <p class="plic">
                                        <span class="ciur-pic">￥100.00</span>
                                        <span class="Ori-pic">￥208.00</span>
                                        <span class="discount">5折</span>
                                    </p>
                                </div>
                            </div>
                            <div class="item">
                                <img src="../Content/static/img/tuan_img3.jpg" alt="">
                                <div class="text-box">
                                    <p class="title">333饭碗四套+调羹+筷子自助学吃饭套装</p>
                                    <p class="plic">
                                        <span class="ciur-pic">￥100.00</span>
                                        <span class="Ori-pic">￥208.00</span>
                                        <span class="discount">5折</span>
                                    </p>
                                </div>
                            </div>
                            <div class="item">
                                <img src="../Content/static/img/tuan_img4.jpg" alt="">
                                <div class="text-box">
                                    <p class="title">333保饭碗四套+调羹+筷子自助学吃饭套装</p>
                                    <p class="plic">
                                        <span class="ciur-pic">￥100.00</span>
                                        <span class="Ori-pic">￥208.00</span>
                                        <span class="discount">5折</span>
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div id="demo2" style="text-align: center;"></div>
                    </div>*@
            </div>
        </div>

    </div>
</div>

<script>

    layui.config({
        base: '../Content/static/js/util/' //你存放新模块的目录，注意，不是layui的模块目录
    }).use(['mm', 'laypage', 'jquery'], function () {
        var laypage = layui.laypage, $ = layui.$;
        mm = layui.mm;
        //laypage.render({
        //    elem: 'demo0'
        //    , count: 100 //数据总数
        //});
        //laypage.render({
        //    elem: 'demo1'
        //    , count: 100 //数据总数
        //});
        //laypage.render({
        //    elem: 'demo2'
        //    , count: 100 //数据总数
        //});


        $('body').on('click', '*[data-content]', function () {
            $(this).addClass('active').siblings().removeClass('active')
            var dataConte = $(this).attr('data-content');
            $('*[cont]').each(function (i, item) {
                var itemCont = $(item).attr('cont');
                console.log(item)
                if (dataConte === itemCont) {
                    $(item).removeClass('layui-hide');
                } else {
                    $(item).addClass('layui-hide');
                }
            })
        })
    });
</script>
